using System.Collections;
using UnityEngine;
using System;
public class WeaponManager : MonoBehaviour { }

public interface IWeapon {
	void Shoot (Vector3 pos);
}
[Serializable]
public class Bullet : IWeapon {
	public  void  Shoot (Vector3 pos) {

		Vector3 initialPosition = new Vector3 (pos.x, pos.y + 1f, 0);
		GameObject bullet = MonoBehaviour.Instantiate (Resources.Load ("BulletPrefab", typeof (GameObject))) as GameObject;
		bullet.transform.position = initialPosition;
		bullet.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0f, 3f);
	}
}
public class Missile : IWeapon {
	public  void Shoot (Vector3 pos) {

		Vector3 initialPosition = new Vector3 (pos.x, pos.y + 1f, 0);
		GameObject missile = MonoBehaviour.Instantiate (Resources.Load ("MissilePrefab", typeof (GameObject))) as GameObject;
		missile.transform.position = initialPosition;
		missile.GetComponent<Rigidbody2D> ().velocity = new Vector2 (0f, 3f);

	}
}